﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>泽优小文件上传控件演示页面</title>
    <link href="js/up2.css" type="text/css" rel="Stylesheet"/>
    <script src="js/jquery-1.3.2.min.js" type="text/javascript"></script>
    <script src="js/json2.min.js" type="text/javascript"></script>
    <script src="js/up2.app.js" type="text/javascript" charset="utf-8"></script>
    <script src="js/up2.edge.js" type="text/javascript" charset="utf-8"></script>
    <script src="js/up2.js" type="text/javascript" charset="utf-8"></script>
    <script src="js/up2.file.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
    <p>此页面演示多文件上传，自定义文件路径功能。</p>
    <p>查看<a href="single.html" target="_blank">单文件上传演示</a></p>
    <p>输入本地文件路径可上传指定路径的文件。</p>
    <p>
        文件路径：<input id="filePath" type="text" size="50" value="D:\\360safe-inst.exe" />&nbsp;
        <input id="btnUpF" type="button" value="上传本地文件" />
    </p>
    <div id="file-panel"></div>
    <div id="msg"></div>
	<script type="text/javascript" language="javascript">
        //根路径：http://localhost/api/up6/
        var pos = window.location.href.lastIndexOf("/");
        var api = [
            window.location.href.substr(0, pos + 1),
            "asp/upload.asp"
        ].join("");

        var fileMgr = new HttpUploaderMgr({
            Config: {
                Droper: false,
                AutoPost:false,
                PostUrl:api
            },
            event: {
                //文件上传完毕
                post_complete: function (url) { $("#msg").append(url + "<br/>"); },
                //队列上传完毕
                queue_complete: function () { },
                add_file: function (f/*HttpUploader*/) { $("#msg").append(f.fileLoc.path + "<br/>"); }
            },
            ui: { render:"file-panel"}
        });

        $(function ()
        {
            //上传本地文件
            $("#btnUpF").click(function ()
            {
                fileMgr.app.addFile({ path: $("#filePath").val() });
            });
        });
	</script>
</body>
</html>